package com.lanou3g.code0413.stream;

/**
 * Created by dllo on 18/4/13.
 */
public class Test02 {
    public static void main(String[] args) {

        int a = fun1();

    }

    public static int fun1() {

        try {
            return 3;

        } catch (Exception e) {
            return 4;

        } finally {
            //可以保证,无论什么情况,里面的代码一定会被执行,通常就是用来释放资源(关流)
            int a = 5;
            System.out.println("finally" + a);
        }
    }


    public static int fun() {

        int a = 3;
        try {
            a = 4 / 0;

        } catch (Exception e) {
            a = 5 / 0;

        } finally {
            //可以保证,无论什么情况,里面的代码一定会被执行,通常就是用来释放资源(关流)
            a = 6;
            System.out.println(a);
        }

        return a;
    }


}
